import os
from tqdm import tqdm
from .base import Tool
from .execute_command import execute as execute_command

def execute(params: dict) -> str:
    """执行complete_task工具"""
    try:
        message = params.get("message", "任务完成")
              
        return message
        
    except Exception as e:
        return f"完成任务失败: {str(e)}"

TOOL = Tool(
    name="complete_task",
    description="表示任务已完成，并提供完成信息",
    parameters={
        "message": {
            "type": "string",
            "description": "完成信息",
            "required": True
        }
    },
    example='''<complete_task>
<message>文件已保存到test.txt</message>
</complete_task>
''',
    execute_func=execute
)